﻿$(function(){//延迟加载
	var dvId='';
	var jfId='';
	var dvbelong='';
	var dvname='';
	var dvip='';
	$('#ss').searchbox({ 
		searcher:function(value,name){ 
			if(value==''){
				return;
			}			
			$('#searchres').datagrid({
				url:'getdvsearchlist',
				queryParams:{
					dvbelong:name,
					ipname:value,
				},
				pagination:true,
				rownumbers:true,
				singleSelect:true,
				height:'450px',
				columns:[[{
					field:'dvbelong',
					title:'设备类型',
					width:'10%'
				},{
					field:'dvname',
					title:'设备名称',
					width:'30%'
				},{
					field:'dvip',
					title:'设备IP',
					width:'15%'
				},{
					field:'juxiang',
					title:'局向',
					width:'8%'
				},{
					field:'jfname',
					title:'机房名称',
					width:'12%'
				},{
					field:'dvfirm',
					title:'设备厂商',
					width:'10%'
				},{
					field:'modelname',
					title:'设备型号',
					width:'10%'
				}]],
				onClickRow:function(index,row){
					dvname=row.dvname;
					dvbelong=row.dvbelong;
					dvId=row.dvId;
					jfId=row.jfId;
				},
				onDblClickRow:function(index,row){
					dvId=row.dvId;
					dvip=row.dvip;
					var p_file_path=parent.getCookie('my_crt_path');//CRT路径
					if(p_file_path==null || p_file_path=='undefined'||p_file_path==''){
						parent.setcrtpathcookie();
						return;
					}
				parent.RunExe(p_file_path,dvip);
				}
			});
		}, 
		menu:'#mm', 
		prompt:'设备IP/名称/机房局向..' 
	});
	$('#dvtp').click(function(){
		parent.addTab(dvname,'tojxtp?dvIds='+dvbelong+','+dvId,'zzjg');
	});
	
	$('#dvdetailtp').click(function(){
		parent.addTab(dvname,'tojxtp?dvIds='+dvbelong+','+dvId+'&sectype=1','zzjg');
	});
	
	$('#dvloc').click(function(){
		parent.addTab('地理位置','tobaidujfmap?jfId='+jfId,'zzjg');
	});
	
	$('#dvdetail').click(function(){
		parent.addTab('设备详细信息编辑','toeditdv?dvbelong='+dvbelong+'&dvId='+dvId,'edit');
	});
});